package com.hjn.study.prototype;

public class UserTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        User user1 = User.getUser();
        user1.setName("hjn2");
        User user2 = User.getUser();
        User user3 = User.getUser();
        System.out.println(user1);
        System.out.println(user2);
        System.out.println(user3);
        //克隆题互不相干，不影响本体(孙悟空？)
        System.out.println(user1 == user2); //false
        System.out.println(user2 == user3); //false

    }
}
